#pragma once

#include "Types.h"
#include "RefCount.h"
#include "Singleton.h"
#include <vector>

class CNavigationManager : public TRefCount<CNavigationManager>, public TSingleton<CNavigationManager>
{
public:
	
	vector3df getProjectedPosition(CSceneObject *, f32 seconds); 
	std::vector<vector3df> getProjectedCourse(CSceneObject *, f32 seconds);
	bool getInterceptCourse(CSceneObject *srcObject, CSceneObject *targetObject,std::vector<vector3df> & interceptCourse, vector<f32> & flightTimes, f32 accel);

	/* Constructors / Destructors */
	CNavigationManager(void);
	CNavigationManager(CSceneObject *obj);
	~CNavigationManager(void);

	/* Interception math helpers */
	bool Intercept(CSceneObject *target, CSceneObject *src, f32 projAccel, f32 projVelocity, f32 projPositionOffset, f32 BurnTime, f32 FaultTolerance, 
							std::vector<vector3df>& vectors, vector<f32> & flightTimes);
	bool Intercept(vector3df targetPosition, vector3df targetVelocity, vector3df targetAcceleration, 
			   vector3df srcPosition, vector3df srcVelocity, f32 projAccel, f32 projVelocity, f32 projPositionOffset,
			   int rbt, double tolerance, std::vector<vector3df>& vectors, vector<f32> & flightTimes);

	/* Member Properties */
	DECLARE_MEMBER(CSceneObject *, UserObject)
	DECLARE_MEMBER(CSceneObject *, Target)

protected:
	IPhysxManager *mSimulator;
};
